Skip to content

适配讯飞星火4.0模型,新增讯飞星火自定义prompt功能#239

Merged
wangrongding merged 2 commits intowangrongding:mainfrom
printlndarling:main
Feb 22, 2025
Merged

适配讯飞星火4.0模型,新增讯飞星火自定义prompt功能#239
wangrongding merged 2 commits intowangrongding:mainfrom
printlndarling:main

Conversation

@printlndarling
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Owner

@wangrongding wangrongding left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

完成以上 review 的反馈后,我将快速合并

Comment thread src/xunfei/xunfei.js Outdated
{ role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果
// { role: 'user', content: '你是谁' }, //# 用户的历史问题
{ role: 'system', content: prompt }, //# 自行设定的prompt
// { role: 'assistant', content: '你是一个专业的智能助手' }, //# AI的历史回答结果
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里做一下兼容处理,如果没填自定义 prompt 还用之前的

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prompt已做处理

Comment thread src/xunfei/xunfei.js Outdated
const apiSecret = env.XUNFEI_API_SECRET
// 地址必须填写,代表着大模型的版本号!!!!!!!!!!!!!!!!
const httpUrl = new URL('https://spark-api.xf-yun.com/v3.5/chat')
const httpUrl = new URL('https://spark-api.xf-yun.com/v4.0/chat')
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是不是现在将版本号放到 env 里去配置更好,因为默认的会导致部分用户不看代码,不知道为什么匹配不上模型

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已修改,.env里面也有说明

@wangrongding wangrongding merged commit e3bfd7b into wangrongding:main Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants